﻿/*----------------------------------------------------------------
    // Copyright (C) 2009 江苏华招网
    // 版权所有。 
    // 作者：马毅
    //
    // 文件名：OperationLog.cs
    // 文件功能描述：企业查看日志
    // 创建标识：马毅2009-05-12
    //
    // 修改标识： 
    // 修改描述： 
    //
    // 修改标识： 
    // 修改描述： 
    //
    // 审核人： 
    // 审核时间： 
    // 审核说明： 
 //----------------------------------------------------------------*/
using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HZ.DrugTrade.BLLFactory;
using HZ.DrugTrade.IBLL;
using HZ.Common;
using HZ.DrugTrade.Model;

namespace HZ.DrugTrade.Web.Enterprise.SystemManage
{
    public partial class OperationLog : BasePage
    {

        public OperationLog()
        { }
        string  aOperateMessage;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                QueryData();
            }
        }
        private void QueryData()
        {
            User currentUser = CurrentAccount.GetUser();
            KeyOperationLog aOperator = new KeyOperationLog();
            if (HZ.Common.MyValidate.IsDate(txtOperateTimeBegin.Text.Trim()))
            {
                aOperator.OperateTimeFrom = Convert.ToDateTime(txtOperateTimeBegin.Text.Trim());
            }
            if (HZ.Common.MyValidate.IsDate(txtOperateTimeEnd.Text.Trim()))
            {
                aOperator.OperateTimeTo = Convert.ToDateTime(txtOperateTimeEnd.Text.Trim());
            }
            int totalRecord = 0;
            IBLL_Log ilog = Factory.BLL_Log();
            aOperator.Operator = txtOperator.Text.Trim();

            aOperator.OrgID = currentUser.Org.OrgID;
            aOperateMessage = txtOperateMessage.Text.Trim();
            this.gvwOperationLog.PageSize = AspNetPager1.PageSize;
            this.gvwOperationLog.DataSource = ilog.GetKeyOperationLogByWhere(aOperator, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize, out totalRecord);
            AspNetPager1.RecordCount = totalRecord;
            this.gvwOperationLog.DataBind();
        }

        /// <summary>
        /// 翻页
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void AspNetPager1_OnPageChanged(object sender, EventArgs e)
        {
            QueryData();
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnQuery_Click(object sender, EventArgs e)
        {
            QueryData();
        }
    }
}
